#pragma once

struct SDL_Surface;

#include "SDL_stdinc.h"

#include <string>

struct SDL_Texture;
struct SDL_Surface;
struct SDL_Renderer;

namespace ZeEngine
{  
    class SDLTexture;

    class ResourceLoader
    {
    public:
        ResourceLoader(SDL_Renderer* m_pRenderer);
        ~ResourceLoader(){}

        /*
        int LoadImage(const std::string iFileName, Sint32* width, Sint32* height, Sint32* bpp, bool createMipmap = false);
        void UnloadImage(unsigned int handle, const std::string& path);
        */

        SDL_Texture* LoadTexture(const std::string& iFileName);
        void UnloadTexture(SDL_Texture* pImage);

        /*
        Mix_Chunk* loadSound(const std::string iFileName);
        void unloadSound(Mix_Chunk* iSound, const std::string iFileName);

        bool loadFont(const std::string iFileName);
        void unloadFont(const std::string iFileName);
        */

    private:       
        int CreateTexture(SDL_Surface* surface, const std::string& iFileName, Sint32* width, Sint32* height, Sint32* bpp, bool createMipmap);
        Sint32 ResourceLoader::GetPixel(SDL_Surface* surface, int x, int y);

        SDL_Renderer* m_pRenderer;
    };
}